﻿Imports System.Data
Public Class frm_MyRoutes

    Dim dt_Route As DataTable
    Private Sub dat_DateRoute_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dat_DateRoute.ValueChanged
        'load data to grid base on 
        'Dim str As String = "rouDate = '" + dat_DateRoute.Value.ToLongDateString() + "'"
        dg_Route.DataSource = dt_Route '.Select(str)
    End Sub

    Private Sub frm_MyRoutes_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        dt_Route = New DataTable
        Dim col As New DataColumn
        col.DataType = System.Type.GetType("System.DateTime")
        col.ColumnName = "rouDate"
        dt_Route.Columns.Add(col)

        dt_Route.Columns.Add("rouName")
        dt_Route.Columns.Add("rouDesc")

        dt_Route.Rows.Add(New Date(2013, 5, 1), "Pasteur", "From 1 to 277 Pasteur. 15 shops")
        dt_Route.Rows.Add(New Date(2013, 5, 1), "Calmette", "All. 5 shops")
        dt_Route.Rows.Add(New Date(2013, 5, 2), "Yersin", "3 shops")
        dt_Route.Rows.Add(New Date(2013, 5, 3), "Cong Hoa", "From 19 to 540. 6 shops")
        dt_Route.Rows.Add(New Date(2013, 5, 3), "Ly Chinh Thang", "2 shops")


    End Sub

    
    Private Sub dg_Route_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles dg_Route.MouseUp
        Dim str As String = dg_Route.Item(dg_Route.CurrentRowIndex, 0)
        Dim rDetail As New frm_RouteDetail
        rDetail.Text = str
        rDetail.Show()
    End Sub
End Class